<div>
    <table class="table table-bordered">
        <tr>
            <th>SequenceNo</th>
            <th>区域Id</th>
            <th>类型</th>
            <th>Name</th>
            <th>金额</th>
            <th style="width: 80px;">ActionList</th>
        </tr>
        <#if list??&&list?size gt 0>
        <#list list as t>
        <tr>
            <td>${t_index+1}</td>
            <td>${(t.department.name)!}</td>
            <td><#if ((t.catagory)!'1')=='1'>金额优惠券<#else>时长优惠券</#if></td>
            <td>${(t.name)!}</td>
            <td>${(t.value)!}</td>
            <td style="width: 80px;">
                <a onclick="choose('${t.id?c}','${riderId?c}')" href="#">选择</a>
            </td>
        </tr>
    </#list>
    <#else>
    <tr>
        <td colspan="11" align="center">no record!</td>

    </tr>
</#if>
</table>
</div>
<script>
    function choose(discountId,riderId) {
        $.ajax({
            type: "GET",
            url: "${base}/admin/discountLog/handle?discountId="+discountId+"&riderId="+riderId,
            cache:false,
            dataType: "json",
            success: function(data){
                alert("设置 Success");
                document.location.reload();
            },
            error:function(error){
                console.log(error);
                alert("系统未知异常!");
            }
        });
    }
</script>